﻿@using LightSO.CMS.Model.EasyUI
@{
    ViewBag.Title = "用户管理";
    Layout = "~/Views/Shared/_Datagrid.cshtml";
    
    //初始化表格基本信息
    Datagrid grid = Datagrid.Create(ViewBag);
    grid.Id = "User"; //表格的Id
    grid.Url = "/api/user/list/1"; //获取表格数据的Url地址
    grid.ScriptSrc = "../Scripts/Logic/User/index.js"; //引用js文件
    grid.Add(new Column("Id", "ID", 20));
    grid.Add(new Column("LoginName", "登录名", 20));
    grid.Add(new Column("Name", "用户名", 20));
    grid.Add(new Column("IsAdmin", "是否超级管理员", 20));
    grid.Add(new Column("CreateOn", "创建时间", 20));
}


@*格式化 IsAdmin 字段的显示方式*@
@section IsAdminColumnFormat{
    <script>
        this.formatter = function (value, row, index) {
            if (row.IsAdmin)
                return '是';
            else
                return '否';
        }
    </script>
}

@*定义过滤条件面板*@
@section ToolbarFilter{
    <div>
        <form id="@(grid.Id)_SearchForm">
            
        </form>
    </div>
}


@*定义右键菜单*@
@section PopupMenu {
    @Html.Menu("Add", "新增", "easymvc.add()", "icon-add")
    @Html.Menu("Edit", "修改", "easymvc.edit()", "icon-edit")
    @Html.Menu("Delete", "删除", "easymvc.delete()", "icon-remove")
}

@*定义工具条菜单*@
@section ToolbarMenu{
    @Html.Button("Add", "新增", "easymvc.add()", "icon-add")
    @Html.Button("Edit", "修改", "easymvc.edit()", "icon-edit")
    @Html.Button("Delete", "删除", "easymvc.delete()", "icon-remove")
}

